package com.hsy.crm.web.mapper;

import com.hsy.crm.web.config.CrmMapper;
import com.hsy.crm.web.domain.entity.Message;
import com.hsy.crm.web.domain.entity.StoreProductDetail;
import com.hsy.crm.web.domain.po.asyn.ProductCostPo;

import java.util.List;

public interface StoreProductDetailMapper extends CrmMapper<StoreProductDetail> {

    /**
     * 最早的一次入库明细
     */
    StoreProductDetail getFirstStoreProductDetail(StoreProductDetail storeProductDetail);

    StoreProductDetail getLastSaleStoreProductDetail(StoreProductDetail storeProductDetail);

    StoreProductDetail getUnCalcStoreProductDetail(StoreProductDetail storeProductDetail);

    int addOut(StoreProductDetail storeProductDetail);

    int addOutTmp(StoreProductDetail storeProductDetail);

    int clearTmp(StoreProductDetail storeProductDetail);

    int clearOut(StoreProductDetail storeProductDetail);

    int updateRushBack(StoreProductDetail storeProductDetail);

    int sumStockNumber(Message message);

    StoreProductDetail selectRepeatSortDetail(StoreProductDetail storeProductDetail);

    Long selectMaxSort(String customerId);

    ProductCostPo selectStockCost(StoreProductDetail storeProductDetail);

    ProductCostPo selectLastBuyCost(StoreProductDetail storeProductDetail);

    StoreProductDetail selectBySaleOrderDetail(StoreProductDetail storeProductDetail);

    List<StoreProductDetail> selectOutByTime(StoreProductDetail storeProductDetail);

    List<StoreProductDetail> selectInByTime(StoreProductDetail storeProductDetail);

}
